package com.my.screenadapter.push;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;


import com.my.screenadapter.Base.BaseActivity;
import com.my.screenadapter.R;

import butterknife.BindView;
import cn.jpush.android.api.JPushInterface;

/**
 * Created by 张英杰 on 2018/1/29.
 */

public class JPushMsgActivity extends BaseActivity {
    @BindView(R.id.tv_1)
    TextView tv1;

    @Override
    protected void init() {
        String title = "";
        String content = null;
        Intent intent = getIntent();
        if (null != intent) {
            Bundle bundle = getIntent().getExtras();

            if (bundle != null) {
                title = bundle.getString(JPushInterface.EXTRA_NOTIFICATION_TITLE);
                content = bundle.getString(JPushInterface.EXTRA_ALERT);
            }
            tv1.setText("Title : " + title + "  " + "Content : " + content);
        }

//        TextView tv = new TextView(this);
//        tv.setText("用户自定义打开的Activity");
//
//        addContentView(tv, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
    }

    @Override
    protected int initLayoutId() {
        return R.layout.activity_jpush_msg;
    }


}
